#include <iostream>
#include <vector>
using namespace std;


    int peakIndexInMountainArray(vector<int>& arr) {
        int left, right;
        left = 0;
        right = arr.size();
        while (left + 1 < right) {
            int mid = (right + left) / 2;
            if (arr[mid] > arr[mid - 1])left = mid;
            else right = mid;
        }
        return left;
    }


    int main() {
        vector<int> arr;
        arr.push_back(3);
        arr.push_back(5);
        arr.push_back(3);
        arr.push_back(2);
        arr.push_back(0);
        int ret = peakIndexInMountainArray(arr);
        cout << ret << endl;
        return 0;
    }